package cn.iocoder.yudao.module.crossborder.platform.controller.admin.platformapiconfig.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Schema(description = "管理后台 - 跨境电商平台API配置新增/修改 Request VO")
@Data
public class PlatformApiConfigSaveReqVO {

    @Schema(description = "API配置编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "30948")
    private Long id;

    @Schema(description = "平台编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11830")
    @NotNull(message = "平台编号不能为空")
    private Long platformId;

    @Schema(description = "店铺编号（为空表示平台级配置）", example = "28941")
    private Long storeId;

    @Schema(description = "API类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotEmpty(message = "API类型不能为空")
    private String apiType;

    @Schema(description = "API名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
    @NotEmpty(message = "API名称不能为空")
    private String apiName;

    @Schema(description = "API端点", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "API端点不能为空")
    private String apiEndpoint;

    @Schema(description = "HTTP方法", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "HTTP方法不能为空")
    private String httpMethod;

    @Schema(description = "请求头配置JSON")
    private String requestHeaders;

    @Schema(description = "请求参数配置JSON")
    private String requestParams;

    @Schema(description = "响应映射配置JSON")
    private String responseMapping;

    @Schema(description = "每分钟请求限制")
    private Integer rateLimitPerMinute;

    @Schema(description = "每小时请求限制")
    private Integer rateLimitPerHour;

    @Schema(description = "每天请求限制")
    private Integer rateLimitPerDay;

    @Schema(description = "超时时间（秒）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "超时时间（秒）不能为空")
    private Integer timeoutSeconds;

    @Schema(description = "重试次数", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "重试次数不能为空")
    private Integer retryTimes;

    @Schema(description = "重试间隔（秒）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "重试间隔（秒）不能为空")
    private Integer retryIntervalSeconds;

    @Schema(description = "状态（0正常 1停用）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "状态（0正常 1停用）不能为空")
    private Integer status;

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否启用不能为空")
    private Boolean enabled;

    @Schema(description = "备注", example = "你说的对")
    private String remark;

}